package com.advertisementsystem.Exception;


import lombok.Getter;

/**
 * 业务异常类
 */
@Getter
public class BusinessException extends RuntimeException {

    /**
     * 错误码
     */
    private final ResultCode resultCode;

    /**
     * 错误消息
     */
    private final String message;

    public BusinessException(String message) {
        this(ResultCode.FAILED, message);
    }

    public BusinessException(ResultCode resultCode) {
        this(resultCode, resultCode.getMessage());
    }

    public BusinessException(ResultCode resultCode, String message) {
        super(message);
        this.resultCode = resultCode;
        this.message = message;
    }
}